Switches to eased auto-follow: every frame, the camera eases toward target’s current position (clamped to camera_bounds, if any are set), using IGUN’s own integer-lag rule exactly.
camera_follow(target)| Name | Type |
|---|---|
target | ref<object> |
Nothing.
Switches the camera to eased auto-follow: every frame, it eases toward target's current position (clamped to camera_bounds, if any are set), using the engine's own integer-lag easing so a moving target never visibly wobbles by a pixel the way a naive fractional-position ease would. If target stops existing, the camera simply stays put where it last was - it does not un-follow itself or jump anywhere on its own.
The camera keeps the followed instance in the middle of the screen once it has caught up (unless the bounds hold it back), so camera_x(), which is where the view begins, ends up half a screen to the left of the target's x.
The easing speed itself is camera_follow_ease's own setting (0.08/0.08 by default) - this call only ever changes WHO is followed, never how quickly.
var target = instance_nearest(x, y, obj_doc_hero);
camera_follow(target);Finds the nearest obj_doc_hero and has the camera follow it from here on - the usual way a room hands the camera off to the player at the start of play.
If target stops existing, the camera simply stays where it last was - it does not un-follow itself or jump anywhere. The easing speed itself is camera_follow_ease’s own setting (0.08/0.08 by default) - this call only ever changes WHO is followed, never how quickly.